home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 May / SGI IRIX 6.5 Complementary Applications 2004 May.iso / dist / OpenOffice.idb / usr / OpenOffice / help / en / sbasic.jar / text / sbasic / common / 03020303.xml < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-24  |  3.8 KB  |  71 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Lof Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03020303"/><meta name="language" content="en-US"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle1{
  5.                 }
  6.         span.Tabelle1A{
  7.                 width:1.499cm;}
  8.         span.Tabelle1B{
  9.                 width:16.498cm;}
  10.         tr.Tabelle11{
  11.                 }
  12.         td.Tabelle1A1{
  13.                 }
  14.         p.P1{
  15.                 }
  16.         p.P2{
  17.                 }
  18.         span.T1{
  19.                 font-weight:bold;}
  20.         span.fr1{
  21.                 }
  22.         </style></head><body>
  23.   
  24.   
  25.   <help:to-be-embedded Eid="lof" xmlns:help="http://openoffice.org/2000/help">
  26.   <p class="Head1"><help:link Id="66598">Lof Function [Runtime]</help:link></p>
  27.   <p class="Paragraph">Returns the size of an open file in bytes.</p>
  28.   </help:to-be-embedded>
  29.   <p class="Paragraph"><span class="T1">Syntax</span>:</p>
  30.   <p class="Paragraph">Lof (FileNumber) <help:key-word value="Lof" tag="kw66598_1" xmlns:help="http://openoffice.org/2000/help"/></p>
  31.   <p class="Paragraph"><span class="T1">Return value</span>:</p>
  32.   <p class="Paragraph">Long</p>
  33.   <p class="Paragraph"><span class="T1">Parameter</span>:</p>
  34.   <p class="Paragraph">FileNumber: Any numeric expression that contains the file number specified by the Open statement.</p>
  35.   <table><tr class="Tabelle11"><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  36.       <p class="TextInTable"><draw:image draw:style-name="fr1" draw:name="HIND_1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0" xlink:href="66732" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  37.      </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
  38.       <p class="TextInTable">To obtain the length of a file that is not open, use the <span class="T1">FileLen</span> function.</p>
  39.      </span></th></tr></table>
  40.   <p class="Paragraph"/>
  41.   <p class="P2">Example:</p>
  42.   <p class="PropText">Sub ExampleRandomAccess</p>
  43.   <p class="PropText">Dim iNumber As Integer</p>
  44.   <p class="PropText">Dim sText As Variant REM must be a Variant</p>
  45.   <p class="PropText">Dim aFile As String</p>
  46.   <p class="PropText">aFile = "c:\data.txt"</p>
  47.   <p class="PropText"/>
  48.   <p class="PropText">iNumber = Freefile</p>
  49.   <p class="PropText">Open aFile For Random As #iNumber Len=32</p>
  50.   <p class="PropText">Seek #iNumber,1 <text:s text:c="2" xmlns:text="http://openoffice.org/2000/text"/>REM Position at start</p>
  51.   <p class="PropText">Put #iNumber,, "This is the first line of text" <text:s text:c="" xmlns:text="http://openoffice.org/2000/text"/>REM Fill with text</p>
  52.   <p class="PropText">Put #iNumber,, "This is the second line of text"</p>
  53.   <p class="PropText">Put #iNumber,, "This is the third line of text"</p>
  54.   <p class="PropText">Seek #iNumber,2</p>
  55.   <p class="PropText">Get #iNumber,,sText</p>
  56.   <p class="PropText">Print sText</p>
  57.   <p class="PropText">Close #iNumber</p>
  58.   <p class="PropText"/>
  59.   <p class="PropText">iNumber = Freefile</p>
  60.   <p class="PropText">Open aFile For Random As #iNumber Len=32</p>
  61.   <p class="PropText">Get #iNumber,2,sText</p>
  62.   <p class="PropText">Put #iNumber,,"This is a new line of text"</p>
  63.   <p class="PropText">Get #iNumber,1,sText</p>
  64.   <p class="PropText">Get #iNumber,2,sText</p>
  65.   <p class="PropText">Put #iNumber,20,"This is the text in record 20"</p>
  66.   <p class="PropText">Print Lof(#iNumber)</p>
  67.   <p class="PropText">Close #iNumber</p>
  68.   <p class="PropText"/>
  69.   <p class="PropText">end sub</p>
  70.   <p class="PropText"/>
  71.  </body></html>